﻿using Autofac;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Module = Autofac.Module;

namespace DataServices
{
 public    class ServiceModule: Module
    {
		protected override void Load(ContainerBuilder builder)
		{
			//注册 AutoMapperModule
			builder.RegisterModule<AutoMapperModule>();
			//注册Service
			builder.RegisterAssemblyTypes(Assembly.Load("DataServices"))
				.PublicOnly()
				.Where(t => t.Name.StartsWith("Plan1"))
				.AsImplementedInterfaces()
				.InstancePerLifetimeScope();
		}
	}
}
